<?php
		include_once '../inc/config.inc.php';
		include_once '../inc/mysql.inc.php';
		$link=connect();
		$template['title']='成员管理页';
		$template['css']=array('style/public.css');
?>

<?php include 'inc/header.inc.php';  ?>

<div id="main">
		<div class="title">商品管理</div>
		
		<table class="list">
			<tr>
				<th>排序</th>	 	 	
				<th>用户名</th>
				<th>密码</th>
				<th>图像</th>
				<th>真实姓名</th>
				<th>qq</th>
				<th>邮箱</th>
				<th>注册时间</th>
				<th>最后登录时间</th>
				<th>ip地址</th>
				<th>操作</th>
			</tr>
			<?php 
				$query="select * from member";
				$result=execute($link,$query);
				while($data=mysqli_fetch_assoc($result))
				{
					//var_dump($data);

//对url进行编码
$url = urlencode("member_information_del.php?id={$data['mid']}");
//对url进行解码
//var_dump(urldecode($url));
$return_url=$_SERVER['REQUEST_URI'];
$message="你确定要删除{$data['username']}吗？";
$delete_url="confirm.php?url={$url}&return_url={$return_url}&message={$message}";
//var_dump($delete_url);
//定界符前面不能有任何字符
//将数据库的所有的信息输出
$html=<<<START
			<tr>
				<td><input class="sort" type="text" name="sort" /></td>
				<td>id:{$data['mid']}</td>
				<td>{$data['username']}</td>
				<td>{$data['pwd']}</td>
				<td>{$data['photo']}</td>
				<td>{$data['truename']}</td>
				<td>{$data['qq']}</td>
				<td>{$data['email']}</td>
				<td>{$data['regtime']}</td>
				<td>{$data['lasttime']}</td>
				<td>{$data['ip']}</td>
				<td><a href="#">[访问]</a>&nbsp;&nbsp;<a href="member_update.php?id={$data['mid']}">[编辑]</a>&nbsp;&nbsp;<a href="$delete_url">[删除]</a></td>
			</tr>

START;
			echo $html;
				}
				?>	
		</table>
	</div>


<?php include 'inc/footer.inc.php'; ?>